//
//  HMColvPicture.m
//  weibo
//
//  Created by apple on 2016/11/17.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "HMColvPicture.h"
#import "HMColvPictureCell.h"
static NSString *cellID = @"HMColvPictureCellID";
@interface HMColvPicture ()<UICollectionViewDataSource,UICollectionViewDelegate>

@end

@implementation HMColvPicture

-(void)awakeFromNib{
    [super awakeFromNib];
    
    self.dataSource = self;
    self.delegate = self;
    self.bounces = NO;
    [self registerNib:[UINib nibWithNibName:@"HMColvPictureCell" bundle:nil] forCellWithReuseIdentifier:cellID];
//    NSLog(@"%@",self.pictures);
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    return self.pictures.count;
}
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    HMColvPictureCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellID forIndexPath:indexPath];
    
    cell.model = self.pictures[indexPath.item];
    NSLog(@"%@", cell.model);
//    NSLog(@"%zd,%zd",indexPath.item,indexPath.row);
    return cell;
}



@end
